Skip to main content

All Questions

Tagged with
0votes
4answers
172views

bash - slice quoted substrings delimited by spaces into array

following example: string=" 'f o o' 'f oo' 'fo o' " array=($string) echo "${array[0]}" outputs: 'f while the expected output is: 'f o o' The only solution I came with is by ...
Zero's user avatar
0votes
2answers
178views

grep results with spaces and special chars

I am trying to grab results from lshw and add them to a a bash array so I can create a new string. I am using lshw -class disk |egrep -A 7 .'-d' |grep 'product' |cut -b 17- the output looks like this ...
xtree's user avatar

close